home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / awe2-0_1.lha / awe2-0.1 / Src / RCS / Histogram.h,v < prev    next >
Text File  |  1989-05-04  |  2KB  |  136 lines

  1. head     3.3;
  2. branch   ;
  3. access   ;
  4. symbols  ;
  5. locks    grunwald:3.3; strict;
  6. comment  @ * @;
  7.  
  8.  
  9. 3.3
  10. date     89.05.04.14.59.39;  author grunwald;  state Exp;
  11. branches ;
  12. next     3.2;
  13.  
  14. 3.2
  15. date     89.02.20.15.35.03;  author grunwald;  state Exp;
  16. branches ;
  17. next     3.1;
  18.  
  19. 3.1
  20. date     88.12.20.13.49.57;  author grunwald;  state Exp;
  21. branches ;
  22. next     1.2;
  23.  
  24. 1.2
  25. date     88.10.30.13.05.50;  author grunwald;  state Exp;
  26. branches ;
  27. next     1.1;
  28.  
  29. 1.1
  30. date     88.09.18.16.42.09;  author grunwald;  state Exp;
  31. branches ;
  32. next     ;
  33.  
  34.  
  35. desc
  36. @@
  37.  
  38.  
  39. 3.3
  40. log
  41. @Before switching to Libg++ version
  42. @
  43. text
  44. @// This may look like C code, but it is really -*- C++ -*-
  45. // 
  46. // Copyright (C) 1988 University of Illinois, Urbana, Illinois
  47. //
  48. // written by Dirk Grunwald (grunwald@@cs.uiuc.edu)
  49. //
  50. #ifndef HISTOGRAMH
  51. #define HISTOGRAMH
  52. #pragma once
  53.  
  54. #include <Statistic.h>
  55. #include <assert.h>
  56.  
  57. extern const int HistogramMinimum;
  58. extern const int HistogramMaximum;
  59.  
  60. class Histogram : public Statistic {
  61.  
  62.     short howManyBuckets;
  63.     int *bucketCount;
  64.     double *bucketLimit;
  65.  
  66. public:
  67.     
  68.     Histogram(double low, double hi, double bucketWidth = -1.0);
  69.  
  70.     ~Histogram();
  71.  
  72.     virtual void reset();
  73.     virtual void operator+=(double);
  74.  
  75.     int similarSamples(double);
  76.  
  77.     inline int buckets() { return(howManyBuckets); };
  78.  
  79.     inline double bucketThreshold(int i) {
  80.     assert2(i >= 0 && i < howManyBuckets,
  81.         "[Histogram::inBucket] Illegal bucket access");
  82.     return(bucketLimit[i]);
  83.     }
  84.  
  85.     inline int inBucket(int i) {
  86.     assert2(i >= 0 && i < howManyBuckets,
  87.         "[Histogram::inBucket] Illegal bucket access");
  88.     return(bucketCount[i]);
  89.     }
  90.  
  91.     void printBuckets(ostream&);
  92.  
  93.     virtual void classPrintOn(ostream&);
  94. };
  95.  
  96. #endif HISTOGRAMH
  97. @
  98.  
  99.  
  100. 3.2
  101. log
  102. @Start using Gnu library heaps for schedulers
  103. @
  104. text
  105. @d9 1
  106. d11 2
  107. a12 2
  108. #include "Statistic.h"
  109. #include "assert.h"
  110. @
  111.  
  112.  
  113. 3.1
  114. log
  115. @Steay version
  116. @
  117. text
  118. @@
  119.  
  120.  
  121. 1.2
  122. log
  123. @*** empty log message ***
  124. @
  125. text
  126. @@
  127.  
  128.  
  129. 1.1
  130. log
  131. @Initial revision
  132. @
  133. text
  134. @d1 6
  135. @
  136.